﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace licai
{
    public partial class AddExpense : Form
    {
        public AddExpense()
        {
            InitializeComponent();
        }

        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void rdoExpense_CheckedChanged(object sender, EventArgs e)
        {
            cboKind.Items.Clear();
            if (rdoExpense.Checked == true)
            {
                cboKind.Items.Add("生活消费");
                cboKind.Items.Add("固定资产");
                cboKind.Items.Add("娱乐活动");
                cboKind.Items.Add("医疗生活");
                cboKind.Items.Add("教育培训");
                cboKind.Items.Add("其他费用");

            }
            else
            {
                cboKind.Items.Add("工作收入");
                cboKind.Items.Add("投资收入");
                cboKind.Items.Add("其他收入");
            }
            cboKind.SelectedIndex = 0;
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void checkBox5_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            rtxtRemarks.Clear();
            rtxtRemarks.AppendText("保存的信息为:\n");
            rtxtRemarks .AppendText (cboKind .SelectedItem .ToString ());
            rtxtRemarks.AppendText("-");
            rtxtRemarks.AppendText(lstItem .SelectedItem .ToString ());
            rtxtRemarks.AppendText("\n日期");
            rtxtRemarks.AppendText("dtpDate.Value.ToLongDateString()");
            rtxtRemarks .AppendText ("\n说明");
            rtxtRemarks.AppendText("txtExplain.Text");
            rtxtRemarks.AppendText("\n收支人");
            if (chkOwn.Checked) rtxtRemarks.AppendText(chkOwn.Text);
            if (chkFamily.Checked) rtxtRemarks.AppendText(","+chkFamily.Text);
            if (chkRelative.Checked) rtxtRemarks.AppendText(","+chkRelative .Text );
            if (chkFriend.Checked) rtxtRemarks.AppendText(","+chkFriend.Text );
            if (chkColleague.Checked) rtxtRemarks.AppendText(","+chkColleague .Text );
            if (chkOther.Checked) rtxtRemarks.AppendText(","+chkOther .Text );
            rtxtRemarks.AppendText("\n金额");
            rtxtRemarks.AppendText(numAmount .Value .ToString ());


        }

        private void rdoIncome_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void cboKind_SelectedIndexChanged(object sender, EventArgs e)
        {
            lstItem.Items.Clear();
            switch (cboKind.SelectedItem.ToString())
            { 
                case "生活消费":
                    lstItem.Items.Add("生活用品");
                    lstItem.Items.Add("水电费");
                    lstItem.Items.Add("生活用品");
                    lstItem.Items.Add("交通费");
                    break;
                case "娱乐活动":
                    lstItem.Items.Add("桌球");
                    lstItem.Items.Add("KTV");
                    lstItem.Items.Add("网吧");
                    lstItem.Items.Add("旅游");
                    break;
                case "医疗生活":
                    lstItem.Items.Add("体检");
                    lstItem.Items.Add("吃药");
                    lstItem.Items.Add("住院");
                    break;
                case "教育培训":
                    lstItem.Items.Add("学费");
                    lstItem.Items.Add("第二专业");
                    lstItem.Items.Add("学习日语");
                    break;
                case "工作收入":
                    lstItem.Items.Add("工资");
                    break;
                case "投资收入":
                    lstItem.Items.Add("股市");
                    break;
                case "其他收入":
                    lstItem.Items.Add("别人捐赠");
                    break;

            }
            lstItem.SelectedIndex = 0;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void txtExplain_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
